package com.ruoyi.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.ExamMapper;
import com.ruoyi.course.domain.Exam;
import com.ruoyi.course.service.IExamService;

/**
 * 考试事项Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-27
 */
@Service
public class ExamServiceImpl implements IExamService 
{
    @Autowired
    private ExamMapper examMapper;

    /**
     * 查询考试事项
     * 
     * @param id 考试事项主键
     * @return 考试事项
     */
    @Override
    public Exam selectExamById(Long id)
    {
        return examMapper.selectExamById(id);
    }

    /**
     * 查询考试事项列表
     * 
     * @param exam 考试事项
     * @return 考试事项
     */
    @Override
    public List<Exam> selectExamList(Exam exam)
    {
        return examMapper.selectExamList(exam);
    }

    /**
     * 新增考试事项
     * 
     * @param exam 考试事项
     * @return 结果
     */
    @Override
    public int insertExam(Exam exam)
    {
        exam.setCreateTime(DateUtils.getNowDate());
        return examMapper.insertExam(exam);
    }

    /**
     * 修改考试事项
     * 
     * @param exam 考试事项
     * @return 结果
     */
    @Override
    public int updateExam(Exam exam)
    {
        return examMapper.updateExam(exam);
    }

    /**
     * 批量删除考试事项
     * 
     * @param ids 需要删除的考试事项主键
     * @return 结果
     */
    @Override
    public int deleteExamByIds(Long[] ids)
    {
        return examMapper.deleteExamByIds(ids);
    }

    /**
     * 删除考试事项信息
     * 
     * @param id 考试事项主键
     * @return 结果
     */
    @Override
    public int deleteExamById(Long id)
    {
        return examMapper.deleteExamById(id);
    }
}
